Rotating shafts usually contain imperfections that cause vibrations as they turn. As explained below, such vibrations can be represented as a periodic mathematical function. For every such function, there is a corresponding periodic function that will nullify the effects of the vibration. If the corresponding function, or a near approximation thereof, could be converted to a physical force and applied to the rotating shaft, perhaps through a magnetic bearing or another suitable device, then the vibrations could be attenuated within the resolution limits of the apparatus.